<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <my-component>你好
            <template v-slot:second>
                <div>内部结构</div>
            </template>
        </my-component>
    </div>
    <template id="first">
        <div>
            <slot></slot>
            <slot name="second"></slot>
        </div>
    </template>
    <script>
        Vue.component('my-component',{template:'#first'})
        var vm=new Vue({el:'#app'})
        //控制台查看插槽内容
        console.log(vm.$children[0].$slots.second[0].children[0].text)
    </script>
</body>
</html>